<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
    <xsl:template match="record">
        <div class="message">
            <div class="header">
                <b class="name">
                    <xsl:copy-of select="name/text()"/>
                </b>
                <a class="email">
                    <xsl:attribute name="href">mailto:<xsl:copy-of select="./@e-mail/string()"/>
                    </xsl:attribute>
                    <xsl:copy-of select="./@e-mail/string()"/>
                </a>
                <div class="datetime">
                    <xsl:copy-of select="format-dateTime(xs:dateTime(./@date), '[M01]-[D01]-[Y0001] [H01]:[m01]:[s01]')"/>
                </div>
                <a class="action" href="?delete={./@m_id/string()}">delete</a>
                <a class="action copy_im" href="#">I'm</a>
            </div>
            <div class="content">Сообщение: <xsl:copy-of select="content/text()"/>
            </div>
            <xsl:if test="not(image/string() eq '')">
                <div class="image">
                    <img src="/u_images/{image/string()}" alt="" tabindex="1"/>
                </div>
            </xsl:if>
        </div>
    </xsl:template>
</xsl:stylesheet>